package com.lichuandi.controller;

import com.lichuandi.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
public class OrderController {

    // 其他方法...
    @Autowired
    private  OrderService orderService;
    @GetMapping("/order")
    public String order() {
        double vip = orderService.calculateTotal("vipDiscount", 100);
//        double normal = orderService.calculateTotal("normal", 100);
        return String.valueOf(vip);
    }
}
